import rxAjax from '@/assets/js/ajax.js';
import FormUtil from "@/assets/js/FormUtil";
import FormBoListApi from "@/api/form/core/formBoList";

//考勤计算 api接口
export const AtsAttenceCalculateApi = {};

AtsAttenceCalculateApi.baseUrl= '/api-oa/oa/ats/atsAttenceCalculate';
AtsAttenceCalculateApi.exportUrl= AtsAttenceCalculateApi.baseUrl + '/listExport';

//查询列表
AtsAttenceCalculateApi.query=function (parameter) {
  var url= AtsAttenceCalculateApi.baseUrl + '/query';
  return rxAjax.postJson(url,parameter).then (res => {
    return res.result
  })
}

/**
* 获取单记录
* @param pkId
* @returns {*}
*/
AtsAttenceCalculateApi.get =function(pkId) {
  var url= AtsAttenceCalculateApi.baseUrl + '/get?pkId=' + pkId;
  return rxAjax.get(url);
}

//保存数据
AtsAttenceCalculateApi.save =function(parameter) {
  var url= AtsAttenceCalculateApi.baseUrl + '/save';
  return rxAjax.postJson(url,parameter);
}

//删除数据
AtsAttenceCalculateApi.del =function(parameter) {
  var url= AtsAttenceCalculateApi.baseUrl + '/del';
  return rxAjax.postUrl(url,parameter);
}

AtsAttenceCalculateApi.calculationAll =function(dataAll) {
  var url= AtsAttenceCalculateApi.baseUrl + '/calculationAll';
  return rxAjax.postJson(url,dataAll);
}

AtsAttenceCalculateApi.calculationSelect =function(dataAll) {
  var url= AtsAttenceCalculateApi.baseUrl + '/calculationSelect';
  return rxAjax.postJson(url,dataAll);
}
//查找所查询的数据并导出
AtsAttenceCalculateApi.listExport= function (parameter){
    var url= AtsAttenceCalculateApi.baseUrl + '/listExport';
    FormUtil.doExport(url,parameter);
}
//导入
AtsAttenceCalculateApi.doImport=function(formData,callback) {
    var url= AtsAttenceCalculateApi.baseUrl+"/doImport";
    return rxAjax.upload(url,formData,callback);
}
export  default AtsAttenceCalculateApi;

